package com.sean.designpatterns.structure.adaptor;

public class MediaAdapter implements MediaPlayer {
    AdvancedMediaPlayer advancedMediaPlayer;

    public MediaAdapter(String type) {
        if (type.equals("vlc")) {
            this.advancedMediaPlayer = new VlcPlayer();
        } else

            this.advancedMediaPlayer = new Mp4Player();
    }

    @Override
    public void play(String mediaType, String fileName) {
        if(mediaType.equals("vlc")){
            advancedMediaPlayer.playVlc(fileName);
        }else
            advancedMediaPlayer.playMp4(fileName);
    }
}
